package me.zhengjie.modules.inspection.service;

import me.zhengjie.modules.inspection.domain.InspectionItem;
import me.zhengjie.modules.inspection.service.dto.InspectionItemDTO;
import me.zhengjie.modules.inspection.service.dto.InspectionItemQueryCriteria;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
* @author xuyukun
* @date 2019-07-02
*/
// @CacheConfig(cacheNames = "inspectionItem")
public interface InspectionItemService {

    /**
    * queryAll 分页
    * @param criteria
    * @param pageable
    * @return
    */
   // @Cacheable(keyGenerator = "keyGenerator")
    Object queryAll(InspectionItemQueryCriteria criteria, Pageable pageable);

    /**
    * queryAll 不分页
    * @param criteria
    * @return
    */
    // @Cacheable(keyGenerator = "keyGenerator")
    public Object queryAll(InspectionItemQueryCriteria criteria);

    /**
     * findById
     * @param id
     * @return
     */
    // @Cacheable(key = "#p0")
    InspectionItemDTO findById(Long id);

    /**
     * create
     * @param resources
     * @return
     */
    // @CacheEvict(allEntries = true)
    InspectionItemDTO create(InspectionItem resources);

    /**
     * update
     * @param resources
     */
    // @CacheEvict(allEntries = true)
    void update(InspectionItem resources);

    /**
     * delete
     * @param id
     */
    // @CacheEvict(allEntries = true)
    void delete(Long id);

    List<InspectionItem> findByObjectId(int  dictId);

    List<InspectionItem> findByItemIds(List<Long>  itemIds);
}